using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class usercontrol_BestSales : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
		Literal1.Text=GetTopNews();
    }

	private string GetTopNews()
	{
		string strHTML = "";
		//strHTML += "<marquee width=\"1000px\" height=\"135px\"  ";
		//strHTML += "style=\"border:1x solid #dddddd; padding:3px; text-align:justify;\"  ";
		//strHTML += "onmouseover=\"this.stop()\" onmouseout=\"this.start()\" scrollamount=\"2\" scrolldelay=\"1\"  ";
		//strHTML += "direction=\"right\" loop=\"infinite\">";
		BSC_Class.BSCConnection cnn = new BSC_Class.BSCConnection(Session["connect"].ToString());
		DataTable dtProducts = cnn.SelectRows("Select top 10 * from tbProducts order by ProductID Desc");
		foreach (DataRow row in dtProducts.Rows)
		{
			strHTML += "<div style='text-align: center; float: left;'>";
			strHTML += "<a href='" + Page.ResolveUrl("~/Apps/ProductDetail.aspx?pid=") + row["ProductID"].ToString() + "'>";
			strHTML += "<img src='" + Page.ResolveUrl(row["SmallImageURL"].ToString()) + "' width=140px height=140px title='" + row["ProductName"].ToString() + "' />";
			strHTML += "</a></div>";
			strHTML +="<div style='float:left;width:1px; height:140px; margin-top:0px;border-left: 1px dotted #C4C3C3'></div>";					
		}
		//strHTML += "</marquee>";
		return strHTML;
	}
}
